package com.jinghong.registerlogin.controller;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.jinghong.registerlogin.ai.V4OkHttpClientTest;
import com.jinghong.registerlogin.model.dto.EvaluationDTO;
import com.jinghong.registerlogin.model.dto.ExamDTO;
import com.jinghong.registerlogin.model.pojo.*;
import com.jinghong.registerlogin.model.vo.EvaluationVO;
import com.jinghong.registerlogin.model.vo.PaperVO;
import com.jinghong.registerlogin.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * ClassName:ExamController
 * Package:com.jinghong.registerlogin.controller
 * Description:
 *
 * @Author: 寻月君子
 * @CreatTime:2024/5/26 17:04
 * Version:1.0
 */
@RestController
@RequestMapping("/exam")
public class ExamController {
    @Autowired
    private QuestionService questionService;

    @Autowired
    private PaperService paperService;

    @Autowired
    private PaperQuestionService paperQuestionService;

    @Autowired
    private EvaluationQuestionService evaluationQuestionService;

    @Autowired
    private EvaluationService evaluationService;



    @GetMapping("/getPaper")
    public Result getPaper(Integer id) {
        return Result.success(paperService.getIntirePaper(id));
    }


    @PostMapping
    public Result examine(@RequestBody ExamDTO examDTO) {
        return Result.success(evaluationService.insertAfterExam(examDTO));
    }


}
